using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Turquoise.EntityGenerator.Models.Mapping
{
    public class FileHistoryMap : EntityTypeConfiguration<FileHistory>
    {
        public FileHistoryMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.FileName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FileType)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FilePath)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("FileHistory");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.FileId).HasColumnName("FileId");
            this.Property(t => t.FileGuid).HasColumnName("FileGuid");
            this.Property(t => t.FileName).HasColumnName("FileName");
            this.Property(t => t.FileLength).HasColumnName("FileLength");
            this.Property(t => t.FileType).HasColumnName("FileType");
            this.Property(t => t.FileBuffer).HasColumnName("FileBuffer");
            this.Property(t => t.FilePath).HasColumnName("FilePath");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.CreatedBy).HasColumnName("CreatedBy");
            this.Property(t => t.IsApproved).HasColumnName("IsApproved");
            this.Property(t => t.VersionNo).HasColumnName("VersionNo");
            this.Property(t => t.RestoreVersionNo).HasColumnName("RestoreVersionNo");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.UpdatedBy).HasColumnName("UpdatedBy");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
        }
    }
}
